
package com.project.projectA.server;

import org.apache.catalina.startup.Embedded;

/**
 * The Class Start.
 * 
 * @author wuwei
 */
public class Start {

	/** The Constant PORT. */
	public static final int PORT = 8080;

	/** The Constant CONTEXT. */
	public static final String CONTEXT = "/";

	/** The Constant BASE_URL. */
	public static final String BASE_URL = "http://localhost:8080/";

	/**
	 * The main method.
	 * 
	 * @param args
	 *            the arguments
	 * @throws Exception
	 *             the exception
	 */
	public static void main(String[] args) throws Exception {
		System.setProperty("project.name", "projectA");
		Embedded server = TomcatUtils.buildNormalServer(PORT, CONTEXT);
		server.start();

		System.out.println("Hit Enter in console to stop server");
		if (System.in.read() != 0) {
			server.stop();
			System.out.println("Server stopped");
		}
	}

}
